import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '@/views/layout'
import Article from '@/views/article'
import Collect from '@/views/collect'
import Like from '@/views/like'
import User from '@/views/user'
import Detail from '@/views/article-detail'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/layout',
      component: Layout,
      children: [
        { path: '/article', component: Article },
        { path: '/',redirect:'/article'},
        { path: '/collect', component: Collect },
        { path: '/like', component: Like },
        { path: '/user', component: User },
      ],
    },
    {
      path: '/',
      redirect: '/layout',
    },
    {
      path: '/detail',
      component: Detail,
    },
  ],
})

export default router
